package edu.yuhf.service;

import edu.yuhf.domain.ProductImage;
import edu.yuhf.mapper.ProductImageMapper;
import edu.yuhf.service.iface.ProductImageService;
import edu.yuhf.service.iface.ProductService;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class ProductImageServiceImpl  implements ProductImageService {

    @Resource
    ProductImageMapper productImageMapper;

    @Override
    public boolean addImage(ProductImage productImage) {
        boolean flag=false;
        if(productImageMapper.insertImage(productImage)==1){
            flag=true;
        }
        return flag;
    }

    @Override
    public ProductImage getImageById(int id) {
        return productImageMapper.queryImageById(id);
    }

}
